package network

import (
	"gitee.com/doraemon1996/bunny/structure"
)

var (
	// Buffer缓存池
	bufferPool *structure.CachePool[*structure.Buffer]

	// UDP消息包缓存池
	udpPacketPool *structure.CachePool[*UDPPacket]

	// Websocket消息包缓存池
	wsPacketPool *structure.CachePool[*WSPacket]
)

func init() {
	bufferPool = structure.NewCachePool[*structure.Buffer](func() any {
		return new(structure.Buffer)
	})
	udpPacketPool = structure.NewCachePool[*UDPPacket](func() any {
		return new(UDPPacket)
	})
	wsPacketPool = structure.NewCachePool[*WSPacket](func() any {
		return new(WSPacket)
	})
}
